package com.fei.BYSJ.utils;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;


public class HttpServletRequestUtil {
    public static Map<String,Object> getRequestParams(HttpServletRequest request){
        Map<String,String[]> map = request.getParameterMap();
        Map<String,Object>  params = new HashMap<>();
        Set<Map.Entry<String, String[]>> entries = map.entrySet();
        for(Map.Entry<String, String[]> entry : entries){
            params.put(entry.getKey(),entry.getValue()[0]);
        }
        return params;
    }
}
